package com.my.xq.repository;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;

import com.my.xq.domain.CourtRoleQueryParam;
import com.my.xq.domain.entity.CourtRole;
import com.sskj.core.query.annotation.DynamicQuery;
import com.sskj.core.repository.GenericRepository;

public interface CourtRoleRepository extends GenericRepository<CourtRole, String> {
	@DynamicQuery
	Page<CourtRole> findPage(CourtRoleQueryParam oqp, Pageable pageable);

	@Query("SELECT r FROM CourtRole r where r.roleName =?1")
	CourtRole findCourtRoleByName(String roleName);

	/**
	 * 查询委员职务
	 * @return
	 */
	@Query(value = "select r from CourtRole r where r.roleWeight > 300 and r.roleWeight < 400 order by r.roleWeight desc")
	List<CourtRole> findWyDuty();

}
